package com.cuijq.ms.flyweight.v1;

import java.util.HashMap;
import java.util.Map;

/**
 * @author by CuiJQ
 * @Classname ChessBoard
 * @Description ChessBoard Description
 * @Date 2021/5/26 23:56
 */
public class ChessBoard {

  private Map<Integer, ChessPiece> chessPieces = new HashMap<>();

  public ChessBoard() {
    init();
  }

  private void init() {
    chessPieces.put(1, new ChessPiece(1, "車", ChessPiece.Color.BLACK, 0, 0));
    chessPieces.put(2, new ChessPiece(2, "馬", ChessPiece.Color.BLACK, 0,
        1)); //...省略摆放其他棋子的代码...
  }

  public void move(int chessPieceId, int toPositionX, int toPositionY) { //...省略...
  }
}
